<?php

/**
 * @author ducnhat
 * @email ddnhat@gmail.com
 * @copyright 2014
 */

class Default_Model_Contact extends Zend_Db_Table{
	
	protected $_name    = "messages";
    protected $_primary = "id";
    
    public function saveData($data, $items){
    	$db = Zend_Registry::get('db');
        
        $db->beginTransaction();
        
        try{
            $db->insert('messages', $data);
            
            $id = $db->lastInsertId("messages");
            
            $db->commit();
            
            return $id;
        }catch(Exception $e){
            $db->rollBack();
            
            return false;
        }
    }
}